more auto refactoring fixes
authorAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 19 May 2016 00:51:07 +0000 (03:51 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 19 May 2016 00:51:07 +0000 (03:51 +0300)
tests/test_cargo_compile_custom_build.rs
tests/test_cargo_compile_git_deps.rs
tests/test_cargo_compile_path_deps.rs
tests/test_cargo_cross_compile.rs
tests/test_cargo_test.rs

index c74446f637403b19b59ad39188d2a4cc387829f7..d78a23a29e62cd2433fd62dd89b0711382a2cf94 100644 (file)
@@ -471,19 +471,19 @@ test!(testing_and_such {
     println!("test");
     assert_that(p.cargo("test").arg("-vj1"),
                 execs().with_status(0)
-                       .with_stdout("\
+                       .with_stderr("\
 [COMPILING] foo v0.5.0 (file://[..])
 [RUNNING] `[..]build-script-build[..]`
 [RUNNING] `rustc [..] --crate-name foo [..]`
 [RUNNING] `rustc [..] --crate-name foo [..]`
 [RUNNING] `[..]foo-[..][..]`
-
+[DOCTEST] foo
+[RUNNING] `rustdoc --test [..]`")
+                       .with_stdout("
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-[DOCTEST] foo
-[RUNNING] `rustdoc --test [..]`
 
 running 0 tests
 
@@ -730,7 +730,7 @@ test!(build_cmd_with_a_build_cmd {
 
     assert_that(p.cargo_process("build").arg("-v"),
                 execs().with_status(0)
-                       .with_stdout("\
+                       .with_stderr("\
 [COMPILING] b v0.5.0 (file://[..])
 [RUNNING] `rustc [..] --crate-name b [..]`
 [COMPILING] a v0.5.0 (file://[..])
@@ -888,9 +888,10 @@ test!(code_generation {
         "#);
     assert_that(p.cargo_process("run"),
                 execs().with_status(0)
-                       .with_stdout("\
+                       .with_stderr("\
 [COMPILING] foo v0.5.0 (file://[..])
-[RUNNING] `target[..]foo`
+[RUNNING] `target[..]foo`")
+                       .with_stdout("\
 Hello, World!
 "));
 
@@ -1310,7 +1311,7 @@ test!(cfg_test {
             fn test_bar() {}
         "#);
     assert_that(p.cargo_process("test").arg("-v"),
-                execs().with_stdout(format!("\
+                execs().with_stderr(format!("\
 [COMPILING] foo v0.0.1 ({dir})
 [RUNNING] [..] build.rs [..]
 [RUNNING] [..]build-script-build[..]
@@ -1318,28 +1319,28 @@ test!(cfg_test {
 [RUNNING] [..] --cfg foo[..]
 [RUNNING] [..] --cfg foo[..]
 [RUNNING] [..]foo-[..]
-
+[RUNNING] [..]test-[..]
+[DOCTEST] foo
+[RUNNING] [..] --cfg foo[..]", dir = p.url()))
+                       .with_stdout("
 running 1 test
 test test_foo ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-[RUNNING] [..]test-[..]
 
 running 1 test
 test test_bar ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-[DOCTEST] foo
-[RUNNING] [..] --cfg foo[..]
 
 running 1 test
 test foo_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", dir = p.url())));
+"));
 });
 
 test!(cfg_doc {
@@ -1426,34 +1427,34 @@ test!(cfg_override_test {
             fn test_bar() {}
         "#);
     assert_that(p.cargo_process("test").arg("-v"),
-                execs().with_stdout(format!("\
+                execs().with_stderr(format!("\
 [COMPILING] foo v0.0.1 ({dir})
 [RUNNING] `[..]`
 [RUNNING] `[..]`
 [RUNNING] `[..]`
 [RUNNING] [..]foo-[..]
-
+[RUNNING] [..]test-[..]
+[DOCTEST] foo
+[RUNNING] [..] --cfg foo[..]", dir = p.url()))
+                       .with_stdout("
 running 1 test
 test test_foo ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-[RUNNING] [..]test-[..]
 
 running 1 test
 test test_bar ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-[DOCTEST] foo
-[RUNNING] [..] --cfg foo[..]
 
 running 1 test
 test foo_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", dir = p.url())));
+"));
 });
 
 test!(cfg_override_doc {
@@ -1537,7 +1538,8 @@ test!(flags_go_into_tests {
         "#);
 
     assert_that(p.cargo_process("test").arg("-v").arg("--test=foo"),
-                execs().with_status(0).with_stdout("\
+                execs().with_status(0)
+                       .with_stderr("\
 [COMPILING] a v0.5.0 ([..]
 [RUNNING] `rustc a[..]build.rs [..]`
 [RUNNING] `[..]build-script-build[..]`
@@ -1547,8 +1549,8 @@ test!(flags_go_into_tests {
 [COMPILING] foo v0.5.0 ([..]
 [RUNNING] `rustc src[..]lib.rs [..] -L test[..]`
 [RUNNING] `rustc tests[..]foo.rs [..] -L test[..]`
-[RUNNING] `[..]foo-[..]`
-
+[RUNNING] `[..]foo-[..]`")
+                       .with_stdout("
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
@@ -1556,12 +1558,13 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 "));
 
     assert_that(p.cargo("test").arg("-v").arg("-pb").arg("--lib"),
-                execs().with_status(0).with_stdout("\
+                execs().with_status(0)
+                       .with_stderr("\
 [FRESH] a v0.5.0 ([..]
 [COMPILING] b v0.5.0 ([..]
 [RUNNING] `rustc b[..]src[..]lib.rs [..] -L test[..]`
-[RUNNING] `[..]b-[..]`
-
+[RUNNING] `[..]b-[..]`")
+                       .with_stdout("
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
index cff25cb8204e88a0969495de6e3f6538437fd4a2..f1ed636cfe390affca25b6389be9d2e635a6bf5d 100644 (file)
@@ -615,7 +615,7 @@ test!(update_with_shared_deps {
 
     // First time around we should compile both foo and bar
     assert_that(p.cargo_process("build"),
-                execs().with_stdout(&format!("\
+                execs().with_stderr(&format!("\
 [UPDATING] git repository `{git}`
 [COMPILING] bar v0.5.0 ({git}#[..])
 [COMPILING] [..] v0.5.0 ([..])
@@ -670,7 +670,7 @@ To learn more, run the command again with --verbose.
     // Make sure we still only compile one version of the git repo
     println!("build");
     assert_that(p.cargo("build"),
-                execs().with_stdout(&format!("\
+                execs().with_stderr(&format!("\
 [COMPILING] bar v0.5.0 ({git}#[..])
 [COMPILING] [..] v0.5.0 ({dir}[..]dep[..])
 [COMPILING] [..] v0.5.0 ({dir}[..]dep[..])
@@ -998,11 +998,11 @@ test!(dev_deps_with_testing {
     // Make sure we use the previous resolution of `bar` instead of updating it
     // a second time.
     assert_that(p.cargo("test"),
-        execs().with_stdout("\
+                execs().with_stderr("\
 [COMPILING] [..] v0.5.0 ([..])
 [COMPILING] [..] v0.5.0 ([..]
-[RUNNING] target[..]foo-[..]
-
+[RUNNING] target[..]foo-[..]")
+                       .with_stdout("
 running 1 test
 test tests::foo ... ok
 
index 535823874a1063b458174e7a9bf46ccc201af7af..4eb560febf64e8d21156181c11867695527aa1d6 100644 (file)
@@ -741,16 +741,16 @@ test!(dev_deps_no_rebuild_lib {
 
     assert_that(p.cargo("test"),
                 execs().with_status(0)
-                       .with_stdout(&format!("\
+                       .with_stderr(&format!("\
 [COMPILING] [..] v0.5.0 ({url}[..])
 [COMPILING] [..] v0.5.0 ({url}[..])
-[RUNNING] target[..]foo-[..]
-
+[RUNNING] target[..]foo-[..]", url = p.url()))
+                       .with_stdout("
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-", url = p.url())));
+"));
 });
 
 test!(custom_target_no_rebuild {
index 2867619b16c049ce3682392bc93129bc307d54db..2138bc84e9707fc9e7b000618ddd74a3e93e61cf 100644 (file)
@@ -460,23 +460,23 @@ test!(cross_tests {
     let target = alternate();
     assert_that(p.cargo_process("test").arg("--target").arg(&target),
                 execs().with_status(0)
-                       .with_stdout(&format!("\
+                       .with_stderr(&format!("\
 [COMPILING] foo v0.0.0 ({foo})
 [RUNNING] target[..]{triple}[..]bar-[..]
-
+[RUNNING] target[..]{triple}[..]foo-[..]", foo = p.url(), triple = target))
+                       .with_stdout("
 running 1 test
 test test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-[RUNNING] target[..]{triple}[..]foo-[..]
 
 running 1 test
 test test_foo ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", foo = p.url(), triple = target)));
+"));
 });
 
 test!(no_cross_doctests {
@@ -525,15 +525,15 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
     let target = alternate();
     assert_that(p.cargo_process("test").arg("--target").arg(&target),
                 execs().with_status(0)
-                       .with_stdout(&format!("\
+                       .with_stderr(&format!("\
 [COMPILING] foo v0.0.0 ({foo})
-[RUNNING] target[..]{triple}[..]foo-[..]
-
+[RUNNING] target[..]{triple}[..]foo-[..]", foo = p.url(), triple = target))
+                       .with_stdout("
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-", foo = p.url(), triple = target)));
+"));
 });
 
 test!(simple_cargo_run {
index 81ac9d3f5e082c71df5f1859115a822c10432d12..7d0493e3ba7eeece959e181727e771c3d94d3211 100644 (file)
@@ -186,7 +186,8 @@ test!(cargo_test_failing_test {
     assert_that(p.cargo("test"),
                 execs().with_stderr(format!("\
 [COMPILING] foo v0.5.0 ({url})
-[RUNNING] target[..]foo-[..]", url = p.url()))
+[RUNNING] target[..]foo-[..]
+[ERROR] test failed", url = p.url()))
                        .with_stdout_contains("
 running 1 test
 test test_hello ... FAILED
@@ -2058,15 +2059,16 @@ test!(only_test_docs {
     p.build();
 
     assert_that(p.cargo("test").arg("--doc"),
-                execs().with_status(0).with_stdout(&format!("\
+                execs().with_status(0)
+                       .with_stderr(&format!("\
 [COMPILING] foo v0.0.1 ([..])
-[DOCTEST] foo
-
+[DOCTEST] foo"))
+                       .with_stdout("
 running 1 test
 test bar_0 ... ok
 
 test result: ok.[..]
 
-")));
+"));
 });